﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class IQCandidateAproval_2 : System.Web.UI.Page
{
    #region events
    Label lblErrorMessage;
    protected void Page_Load(object sender, EventArgs e)
    {
        lblErrorMessage = (Label)Master.FindControl("lblErrorMessage");
        GetData();
        //if (!IsPostBack)
        //{
        //    GetData();
        //    if (Request.QueryString.Count > 0)
        //    {
        //        ddlCandidate.SelectedIndex = Convert.ToInt16(Request.QueryString["statusid"])-1;
        //        ddlCandidate_SelectedIndexChanged(sender, e);
        //    }
        //    else
        //    {
        //        ddlCandidate_SelectedIndexChanged(sender, e);
        //    }
            
        //}
    }

    private void GetData()
    {
      
        GridView4.DataSource = GetDataSet();
        GridView4.DataBind();

    }

   


    protected void gvSearchResult_OnPageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        //throw new NotImplementedException();
     
    }

    protected void BtnSearch_OnClick(object sender, EventArgs e)
    {
        //throw new NotImplementedException();
        GetData();
    }

    #endregion

    #region Methods
    private DataSet GetDataSet()
    {
        DataSet dsReport = new DataSet();
        DataTable dt = new DataTable();
        dt.Columns.Add("IsArchive", Type.GetType("System.Boolean"));

        
        dt.Columns.Add("RegistrationID");
        dt.Columns.Add("CandidateName");
        dt.Columns.Add("Counrty");
        dt.Columns.Add("CandidateType");

        dt.Columns.Add("ModAssessor");
        dt.Columns.Add("ModAssessorFees");
        dt.Columns.Add("ResearchLead");
        dt.Columns.Add("ResearchLeadFees");
        dt.Columns.Add("Auditor");
        dt.Columns.Add("AuditorFees");
        dt.Columns.Add("Expert");
        dt.Columns.Add("ExpertFees");
        dt.Columns.Add("IQKSManager");
        dt.Columns.Add("IQKSManagerFees");

        dt.Columns.Add("ApplyDate");
        dt.Columns.Add("Company");

        DataRow r = dt.NewRow();

        r["RegistrationID"] = "REG122022014A";
        r["CandidateName"] = "Kalpash Singh";
        r["Counrty"] = "South Africa";
        r["CandidateType"] = "Both";

        r["ModAssessor"] = "Pravin Vani";
        r["ModAssessorFees"] = "100.00";
        r["ResearchLead"] = "Morish Tail";
        r["ResearchLeadFees"] = "200.00";
        r["Auditor"] = "Roger Wan";
        r["AuditorFees"] = "150.00";
        r["Expert"] = "Mantis Rao";
        r["ExpertFees"] = "250.00";
        r["IQKSManager"] = "Roberto Carlos";
        r["IQKSManagerFees"] = "500.00";
        
        r["ApplyDate"] = "24/5/2015";
        r["Company"] = "Fortis Clinical Research ";
        r["IsArchive"] = 0;
        dt.Rows.Add(r);

        DataRow r1 = dt.NewRow();
        r1["RegistrationID"] = "REG122022014A";
        r1["CandidateName"] = "Kalpash Singh";
        r1["Counrty"] = "South Africa";
        r1["CandidateType"] = "Both";

        r1["ModAssessor"] = "Pravin Vani";
        r1["ModAssessorFees"] = "100.00";
        r1["ResearchLead"] = "Morish Tail";
        r1["ResearchLeadFees"] = "200.00";
        r1["Auditor"] = "Roger Wan";
        r1["AuditorFees"] = "150.00";
        r1["Expert"] = "Mantis Rao";
        r1["ExpertFees"] = "250.00";
        r1["IQKSManager"] = "Roberto Carlos";
        r1["IQKSManagerFees"] = "500.00";

        r1["ApplyDate"] = "24/5/2015";
        r1["Company"] = "Fortis Clinical Research ";
        r1["IsArchive"] = 0;
        dt.Rows.Add(r1);
        //pending

        DataRow r2 = dt.NewRow();
        r2["RegistrationID"] = "REG122022014A";
        r2["CandidateName"] = "Kalpash Singh";
        r2["Counrty"] = "South Africa";
        r2["CandidateType"] = "Both";

        r2["ModAssessor"] = "Pravin Vani";
        r2["ModAssessorFees"] = "100.00";
        r2["ResearchLead"] = "Morish Tail";
        r2["ResearchLeadFees"] = "200.00";
        r2["Auditor"] = "Roger Wan";
        r2["AuditorFees"] = "150.00";
        r2["Expert"] = "Mantis Rao";
        r2["ExpertFees"] = "250.00";
        r2["IQKSManager"] = "Roberto Carlos";
        r2["IQKSManagerFees"] = "500.00";

        r2["ApplyDate"] = "24/5/2015";
        r2["Company"] = "Fortis Clinical Research ";
        r2["IsArchive"] = 0;
        dt.Rows.Add(r2);


        r = dt.NewRow();
        r["RegistrationID"] = "REG122022014A";
        r["CandidateName"] = "Kalpash Singh";
        r["Counrty"] = "South Africa";
        r["CandidateType"] = "Both";

        r["ModAssessor"] = "Pravin Vani";
        r["ModAssessorFees"] = "100.00";
        r["ResearchLead"] = "Morish Tail";
        r["ResearchLeadFees"] = "200.00";
        r["Auditor"] = "Roger Wan";
        r["AuditorFees"] = "150.00";
        r["Expert"] = "Mantis Rao";
        r["ExpertFees"] = "250.00";
        r["IQKSManager"] = "Roberto Carlos";
        r["IQKSManagerFees"] = "500.00";

        r["ApplyDate"] = "24/5/2015";
        r["Company"] = "Fortis Clinical Research ";
        r["IsArchive"] = 0;
        dt.Rows.Add(r);


        r = dt.NewRow();
        r["RegistrationID"] = "REG122022014A";
        r["CandidateName"] = "Kalpash Singh";
        r["Counrty"] = "South Africa";
        r["CandidateType"] = "Both";

        r["ModAssessor"] = "Pravin Vani";
        r["ModAssessorFees"] = "100.00";
        r["ResearchLead"] = "Morish Tail";
        r["ResearchLeadFees"] = "200.00";
        r["Auditor"] = "Roger Wan";
        r["AuditorFees"] = "150.00";
        r["Expert"] = "Mantis Rao";
        r["ExpertFees"] = "250.00";
        r["IQKSManager"] = "Roberto Carlos";
        r["IQKSManagerFees"] = "500.00";

        r["ApplyDate"] = "24/5/2015";
        r["Company"] = "Fortis Clinical Research ";
        r["IsArchive"] = 0;
        dt.Rows.Add(r);


        r = dt.NewRow();
        r["RegistrationID"] = "REG122022014A";
        r["CandidateName"] = "Kalpash Singh";
        r["Counrty"] = "South Africa";
        r["CandidateType"] = "Both";

        r["ModAssessor"] = "Pravin Vani";
        r["ModAssessorFees"] = "100.00";
        r["ResearchLead"] = "Morish Tail";
        r["ResearchLeadFees"] = "200.00";
        r["Auditor"] = "Roger Wan";
        r["AuditorFees"] = "150.00";
        r["Expert"] = "Mantis Rao";
        r["ExpertFees"] = "250.00";
        r["IQKSManager"] = "Roberto Carlos";
        r["IQKSManagerFees"] = "500.00";

        r["ApplyDate"] = "24/5/2015";
        r["Company"] = "Fortis Clinical Research ";
        r["IsArchive"] = 0;
        dt.Rows.Add(r);

        r = dt.NewRow();
        r["RegistrationID"] = "REG122022014A";
        r["CandidateName"] = "Kalpash Singh";
        r["Counrty"] = "South Africa";
        r["CandidateType"] = "Both";

        r["ModAssessor"] = "Pravin Vani";
        r["ModAssessorFees"] = "100.00";
        r["ResearchLead"] = "Morish Tail";
        r["ResearchLeadFees"] = "200.00";
        r["Auditor"] = "Roger Wan";
        r["AuditorFees"] = "150.00";
        r["Expert"] = "Mantis Rao";
        r["ExpertFees"] = "250.00";
        r["IQKSManager"] = "Roberto Carlos";
        r["IQKSManagerFees"] = "500.00";

        r["ApplyDate"] = "24/5/2015";
        r["Company"] = "Fortis Clinical Research ";
        r["IsArchive"] = 0;
        dt.Rows.Add(r);

        dsReport.Tables.Add(dt);
        //dsReport = DataUtils.ExecuteDataset("usp_GetBranchDetails", txtSearch.Text.Trim(), txtbranchCode.Text.Trim());
        return dsReport;
    }

    protected void BtnClear_OnClick(object sender, EventArgs e)
    {
        //throw new NotImplementedException();
        //txtLanguageName.Text = "";
        //txtLanguageId.Text = "";
        GetData();
    }

    protected void btnAddNew_OnClick(object sender, EventArgs e)
    {
        //throw new NotImplementedException();
        Session["RegistrationID"] = "0";
        Response.Redirect("~/Admin/LanguageMasterModify.aspx");
    }

    protected void gvSearchResult_OnRowCommand(object sender, GridViewCommandEventArgs e)
    {
        //throw new NotImplementedException();
        WebControl wc = e.CommandSource as WebControl;
        GridViewRow row = wc.NamingContainer as GridViewRow;

        if (row != null)
        {
            int DataItemIndex = row.DataItemIndex;
            DataSet ds = new DataSet();
            ds = GetDataSet();
            if (ds != null)
            {
                DataTable dt = ds.Tables[0];
                Session["RegistrationID"] = dt.Rows[DataItemIndex]["RegistrationID"].ToString();
            }

            if (e.CommandName == "Edit")
            {
                Response.Redirect("~/Admin/LanguageMasterModify.aspx");
            }
        }
    }
    #endregion
    protected void ddlCandidate_SelectedIndexChanged(object sender, EventArgs e)
    {
        
        if (ddlCandidate.SelectedIndex == 0)
        {
           
            Button9.Visible = false;
            Button10.Visible = false;
            GridView4.Visible = false;
        }
        else if (ddlCandidate.SelectedIndex == 1)
        {
            //gvPend.Visible = true;
            //GVApproved.Visible = false;
            //Button9.Visible = false;
            //GridView1.Visible = false;
            //GridView2.Visible = false;
            //GridView3.Visible = false;
          
          
            GridView4.Visible = false;
            
           
        }
        else if (ddlCandidate.SelectedIndex == 2)
        {
          
         
            Button9.Visible = false;
            Button10.Visible = false;
            GridView4.Visible = false;
           


        }
        else if (ddlCandidate.SelectedIndex == 3)
        {
            Button10.Visible = true;
            Button9.Visible = true;
            GridView4.Visible = true;
           

        }
        else if (ddlCandidate.SelectedIndex == 4)
        {

       
            Button9.Visible = false;
            Button10.Visible = false;
            GridView4.Visible = false;
            // trBrief.
        }
        else 
        {
         
            Button9.Visible = false;
            Button10.Visible = false;
            GridView4.Visible = false;
        }
      
    }
    protected void GVApproved_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void GVApproved_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
    {
   
    }
    protected void GVApproved_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
     
    }
    protected void Button9_Click(object sender, EventArgs e)
    {
        Response.Redirect("CandidateApprovalThanks_3.aspx");
    }
    protected void Button10_Click(object sender, EventArgs e)
    {

    }
}